<?php
namespace App\Crontab;

use Hyperf\Contract\StdoutLoggerInterface;
use Hyperf\Crontab\Annotation\Crontab;
use Hyperf\Di\Annotation\Inject;

use App\Service\RateBocService;
use App\Utils\CustomUtils;

/**
 * @Crontab(name="CrawlerBocRateCronTask", rule="0 *\/15 * * * *", callback="execute", memo="这是一个定时的定时任务")
 */
class CrawlerBocRateCronTask
{

    /**
     * @Inject()
     * @var \Hyperf\Contract\StdoutLoggerInterface
     */
    private $logger;

    /**
     * @Inject()
     * @var RateBocService
     */
    private $RateBocService;

    public function execute()
    {
        $this->logger->info(date('Y-m-d H:i:s', time()));
        CustomUtils::xzxDebug("enter crawler boc rate task");
        $this->RateBocService->crawler();
        
    }
}